package santhosh;

import javax.swing.DefaultListModel;

import com.accesshollywood.components.Permissable;
import com.accesshollywood.indexables.Indexed;

// @author Santhosh Kumar T - santhosh@in.fiorano.com
public class DefaultMutableListModel extends DefaultListModel implements MutableListModel{
    public boolean isCellEditable(int index){
    	Object value = this.elementAt(index);
    	if(value instanceof Indexed){
    		Object element = (Indexed)value;
    		if(element instanceof Permissable){
    			return ((Permissable)element).isCurrentUserPermitted();
    		}
    	}
        return true;
    }

    public void setValueAt(Object value, int index){
        super.setElementAt(value, index);
    }
}
